﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="Employees.MainPage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form" runat="server">
    <div>
        <asp:ScriptManager runat="server" ID="ScriptManager"/>
        <asp:UpdatePanel runat="server" ID="UpdatePanelEmployees">
            <ContentTemplate>
                <asp:GridView runat="server" ID="GridEmployees" DataSourceID="LinqEmployees" AutoGenerateColumns="False"
                    DataKeyNames="EmployeeID" 
                    onselectedindexchanged="GridEmployees_SelectedIndexChanged">
                    <Columns>
                        <asp:TemplateField HeaderText="Employee">
                            <ItemTemplate>
                                <asp:LinkButton ID="ButtonLink" Text='<%# Eval("FirstName") + " " + Eval("LastName") %>' runat="server" 
                                    OnClick="ButtonLink_Click" CommandArgument='<%# Eval("EmployeeID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>                        
                <asp:UpdateProgress runat="server">
                    <ProgressTemplate>
                        Updating...
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <asp:GridView runat="server" ID="GridOrders"/>
                <asp:LinqDataSource ID="LinqEmployees" runat="server" 
                    ContextTypeName="Employees.NortWindDataContext" EntityTypeName="" TableName="Employees">
                </asp:LinqDataSource>                
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
